<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>溧宁高速</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>

    <div id="mapContainer" style="position: relative;">
    </div>

</body>
<!-- <script src='http://localhost:9000/examples/GiswayEngine.js'></script> -->
<script src='../resources/GiswayEngine.js'></script>
<script type="text/javascript">
    let cameraFov = 2; //相机视角
    window.app = new GE.App('mapContainer', {
        geographySystem: 'gcj02',
        cameraScrollSpeed: 15,
        minZoom: 3,
        maxZoom: 23,
        cameraFov: cameraFov, //相机的fov
        verticalLevel: 6,
        maxSlopeAngle: 70,

        ambientLightIntensity: 2,
        ambientLightcolor: 0xffffff,//环境光照的颜色
        ambientLightType: 'ambient',//环境光照的类型，有如下类型:ambient，hemisphere
        supportLightType: 'single',//方向光的类型，有如下类型:single，double，tripple
        supportLightIntensity: 1,//方向光的强度
        supportLightcolor: '#ffffff', //方向光的颜色
        lightDistance: 2000,//方向光源距离初始相机target的距离
        lightHeight: 50,//方向光源的高度
        patchLoadCount: 5,
        useCarpet: true,
        background: "Fog",
        useDefaultTexture: false, //是否使用瓦片默认纹理
        baseLayer: [
            {
                url: 'https://webst03.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
                readableUrl: true,
                tileType: 'image',
                maxDataLevel: 17
            },
        ]
    });

    var threeTileModel;
    tiles3d();
    function tiles3d() {
        threeTileModel = new GE.Tiles3d({
            url: '../resources/osgb/溧宁高速/output/tileset.json', refinement: 300, loadRange: 0,//溧宁高速
            isCloseGround: true,
            z: 5, //调整数据的高度， 用户可以根据数据做调整，一般情况下如果isCloseGround为true,可以不设置这个参数
            minSize: 500,
            maxSize: 3000,
            maxBytesSize: 0.3 * 2**10,
            minByteSize: 0.2 * 2**10,
            screenErrorFactor: 1.5, //屏幕误差缩放的倍数
            isOpenAdditionalCamera: false, //是否添加预加载的额外相机
            additionCameraFov: cameraFov * 2, //额外相机的fov
            unloadPercent: 1,
            maxJobs: 15,
            canNotSelect: false, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            isSupportTransparent: false,
            isDoubleSide: false, //是否开启双面渲染
            //changeEmissive: true, //是否开启自发光
            //  geoSystem: '3857', //4978是椭球坐标系，3857是web墨卡托坐标系。这个参数可以不配置，默认是4978
            // isOnlyLoadCoarse: true, //是否只加载最粗略的瓦片
            dracoGltfPath: '../resources/plugin/draco/gltf/', //draco压缩的gltf文件解压后存放的路径
            isLocate: true,
        });
        app.add(threeTileModel);
        window.tiles3d = threeTileModel;
    }


    // window.app.on('Click', function (e) {
    //     console.log(e);
    // });

    // window.app.on('MapDragStart', function (e) {
    //     console.log('地图拖拽开始');
    // });
    // window.app.on('MapDragEnd', function (e) {
    //     console.log('地图拖拽结束');
    // });

</script>

</html>